{extend name="public/base"/}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
		</div>
	</header>
	<div class="main-box-body clearfix">
		<form method="post" class="form form-horizontal" action="edit">
			<div class="tabs-wrapper">
				
				<div class="tab-content">
					<div class="tab-pane fade in active" id="mobile">
						
						<div class="row">
							{volist name="list['mobile']" id="item"}
							<div class="col-sm-4 col-md-3">
								<div class="thumbnail">
									<img src="{$item['img']}" alt="{$item['name']}" class="img-rounded">
									<div class="caption">
										<h4>{$item['name']}<span style="margin-left:30px"><a role="button" class="template-qrcode" data-qrcode-url="{$domain}?themes={$item.id}">预览此模板</a></span></h4>
										<p class="text-right">
											{if $mobile == $item['id']}
											<button class="btn btn-danger btn-block" disabled>已启用</button>
											{else/}
											<a href="{:url('admin/config/setthemes?name=mobile&id='.$item['id'])}" class="btn btn-primary btn-block ajax-get">启用</a>
											{/if}
										</p>
									</div>
								</div>
							</div>
							{/volist}
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>

{/block}
{block name="script"}
<link href="__PUBLIC__/plugs/webui-popover/2.1.15/jquery.webui-popover.min.css" rel="stylesheet">
<script type="text/javascript" src="__PUBLIC__/plugs/webui-popover/2.1.15/jquery.webui-popover.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugs/qrcode.js"></script>
<script type="text/javascript">
$(function() {
    $('.template-qrcode').webuiPopover({
        trigger: 'hover',
        placement: 'right',
        content: function() {
            var url = $(this).data('qrcode-url');
            var $content = $('<div class=".template-qrcode"></div>');

            new QRCode($content[0], {
                text: url,
                width: 120,
                height: 120,
                correctLevel : QRCode.CorrectLevel.H
            });

            return $content;
        }
    });
});
</script>
{/block}